package com.ordobill.remote.communication.resource.ftp;

import static org.junit.Assert.*;
import org.junit.Test;
import com.ordobill.remote.communication.resource.CommunicationResource;

public class CommunicationByFtpTest {

    @Test
    public void testCommunicationByFtp() {
        
        CommunicationResource cr = new CommunicationResource();
        cr.setHostName("61.100.181.242");
        cr.setHostPort(21);
        cr.setCharacterCodeSet("MS949");
        cr.setUserName("bkdbbcweb");
        cr.setUserPw("bkd1234");
        cr.setObjectPathName("/html_source_backup/source/psd");
        cr.setObjectFileName("fla_img.psd");
        cr.setTargetPathName("C:/Users/choijinwook/Pictures/ftpTest");
        cr.setTargetFileName("1.psd");
        
        CommunicationByFtp cbf = new CommunicationByFtp(cr);
        assertTrue(cbf.getSignFromServer()==230 || cbf.getSignFromServer()==250);
        
        String[] fileNames = cbf.fileNameStringArray();
        
        for(String fileName : fileNames){
            //System.out.println(cbf.getSignFromServer());
            System.out.println(fileName);
        }
        
    }

}
